import java.sql.*;

/**
 * @author zhangbingbing
 * @version 1.0
 * @description: TODO
 * @date 2020/12/24 09:42
 */
public class JDBC {

    public static void main(String[] args) throws SQLException {
        // 定义连接
        Connection connection = null;
        PreparedStatement preparedStatement = null;
        ResultSet resultSet = null;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            connection = DriverManager.getConnection("jdbc:mysql://192.9.200.89:3306/aim", "aim", "123456");
            String sql = "select * from aim_statistask_config";
            preparedStatement = connection.prepareStatement(sql);
            resultSet = preparedStatement.executeQuery();
            while (resultSet.next()){
//                ResultSetMetaData metaData = resultSet.getMetaData();
//                System.out.println(metaData.toString());
                String taskname = resultSet.getString("taskname");
                String statissql = resultSet.getString("statissql");
                System.out.println(taskname+"========"+statissql);
            }


        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        resultSet.close();
    }
}
